using System.Windows.Messaging;

namespace com.bodurov.SilverlightControls.XmlCodeEditor
{
    public static class Log
    {
        private readonly static LocalMessageSender _sender = new LocalMessageSender("TestLog", System.Windows.Messaging.LocalMessageSender.Global);
        public static void Debug(string s, params object[] args)
        {
            _sender.SendAsync(args.Length == 0 ? s : string.Format(s, args));
        }
        public static void DebugIf(bool condition, string s, params object[] args)
        {
            if (condition) _sender.SendAsync(args.Length == 0 ? s : string.Format(s, args));
        }
    }
}